/*
 * SPDX-FileCopyrightText: 2022-2023 liulinsong <liulinsong@kylinos.cn>
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 *
 */
#ifndef _FCITX_MODULES_DEVICESTATUSMANAGER_DEVICESTATUSMANAGER_H_
#define _FCITX_MODULES_DEVICESTATUSMANAGER_DEVICESTATUSMANAGER_H_

#include "fcitx/instance.h"

#include "statusmanagerwatcher.h"

namespace fcitx {

class DeviceStatusManager : public AddonInstance {
public:
    explicit DeviceStatusManager(Instance *instance);
    ~DeviceStatusManager() override;

private:
    std::unique_ptr<StatusManagerWatcher::Strategy>
    createPhysicalKeyboardWatcherStrategy();
    std::unique_ptr<StatusManagerWatcher::Strategy>
    createTabletModeWatcherStrategy();

    bool shouldVirtualKeyboardAutoHide() const;
    void updateVirtualKeyboardAutoHide();

private:
    Instance *instance_;

    StatusManagerWatcher physicalKeyboardWatcher_;

    StatusManagerWatcher tabletModeWatcher_;
};

} // namespace fcitx

#endif // _FCITX_MODULES_DEVICESTATUSMANAGER_DEVICESTATUSMANAGER_H_
